----------------------------
-- Simplistic Street
-- by Jammie Dodger
--
-- Project Started - October 20, 2009
-- Completion -None
----------------------------

local enabled	= 1
local coolSpeed	= 1
local maxHeat	= 10

CreateConVar( "ss_enabled", enabled )
CreateConVar( "ss_coolspeed", coolSpeed )
CreateConVar( "ss_maxheat", maxHeat )

function SpawnAnEntity( ply )
		if ( GetConVarNumber( "ss_enabled" ) <= 0 ) then return end
		if ( ( ply.SpamHeat or 0 ) <= ( math.max( GetConVarNumber( "ss_maxheat" ), 0 ) ) - 1 ) then
			ply.SpamHeat = ( ply.SpamHeat or 0 ) + 1
		else
		
		ply:SendLua([[ surface.PlaySound( "buttons/button10.wav" ) ]])
		ply:SendLua([[ GAMEMODE:AddNotify( "Please wait before spawning again!", NOTIFY_ERROR, 3 ) ]])
		
		
			return false
		end
	end
	
function Think()
		local cool = FrameTime() * math.max( GetConVarNumber( "ss_coolspeed" ), 0 )
		for _, ply in pairs( player.GetAll() ) do
			ply.SpamHeat = math.max( ( ply.SpamHeat or 0 ) - cool, 0 )
		end
	end
	hook.Add( "Think", "SS.Think", Think )
	
	hook.Add( "PlayerSpawnEffect", "SS.PlayerSpawnEntity", SpawnAnEntity )
	hook.Add( "PlayerSpawnProp", "SS.PlayerSpawnEntity", SpawnAnEntity )
	hook.Add( "PlayerSpawnNPC", "SS.PlayerSpawnEntity", SpawnAnEntity )
	hook.Add( "PlayerSpawnVehicle", "SS.PlayerSpawnEntity", SpawnAnEntity )
	hook.Add( "PlayerSpawnRagdoll", "SS.PlayerSpawnEntity", SpawnAnEntity )
	